package com.thread.service.impl;

import com.thread.service.AsynService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @Author: 胡成
 * @Version: 0.0.1V
 * @Date: 2018/10/31
 * @Description: 类描述
 **/
@Slf4j
@Service
public class AsynServiceImpl implements AsynService {

    @Override
    @Async("asyncExecutor")//异步线程池执行
    public void executeAsync() {
        log.info("start executeAsync");
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        log.info("end executeAsync");
    }
}
